import turtle as t
import time
import turtle
t1=t.Turtle()
t1.ht()
t.ht()
t.tracer(False)
t.update()
#杆
t1.pu()
t1.goto(-100,-400)
t1.pensize(50)
t1.begin_fill()
t1.color('black','black')
t1.left(90)
t1.forward(700)
t1.left(90)
t1.forward(10)
t1.left(90)
t1.forward(700)
t1.left(90)
t1.forward(10)
t1.end_fill()
#国旗
def flag(x,y):  
    t.setheading(0)
    t.begin_fill()
    t.color('red','red')
    t.penup()
    t.goto(x,y)
    t.forward(300)
    t.right(90)
    t.forward(200)
    t.right(90)
    t.forward(300)
    t.right(90)
    t.forward(200)
    t.end_fill()
#flag(-200,-200) 旗子最起初的数据
def star(an,x,y,l):#an=angle 角度  l=long 长度
    t.color('yellow','yellow')
    t.setheading(an)
    t.penup()
    t.goto(x,y)
    t.pensize(1) 
    t.begin_fill()
    t.forward(l)
    t.right(144)
    t.forward(l)
    t.right(144)
    t.forward(l)
    t.right(144)
    t.forward(l)
    t.right(144)
    t.forward(l)
    t.end_fill()
#star(0,-160,150,70)
#star(270,-85,190,30)
#star(0,-75,150,30)
#star(-15,-75,120,30)
#star(315,-85,105,30)五颗星最起初的数据
def chineseflag(x0,y0,x1,y1,x2,y2,x3,y3,x4,y4,x5,y5):
    flag(x0,y0)
    star(0,x1,y1,70)
    star(270,x2,y2,30)
    star(0,x3,y3,30)
    star(-15,x4,y4,30)
    star(315,x5,y5,30)
chineseflag(-100,-150,-60,-200,15,-160,25,-200,25,-230,5,-245)
y0=-150
y1=-200
y2=-160
y3=-200
y4=-230
y5=-245
for i in range(11):
    chineseflag(-100,y0+i*45,-60,y1+i*45,15,y2+i*45,25,y3+i*45,25,y4+i*45,5,y5+i*45)
    t.tracer(10,1)
    time.sleep(1)
    t.clear()
